﻿<%@ Control Language="C#" AutoEventWireup="true" CodeFile="SearchResultsControl.ascx.cs" Inherits="SearchResultsControl" %>

<table class="displayTable">
	<thead>
		<tr>
			<th>User</th>
			<th>Zip Code</th>
			<th>Contact User</th>
			<th colspan="2">Times</th>
		</tr>
	</thead>
	<tbody>
	<%	int i = 0;
		foreach (User user in this.schedules.Keys) {
			string clazz = "even";
			if (i == 1) {
				clazz = "odd";
			} %>
			<tr>
				<td class="<%=clazz %>"><%=user.LastName%>, <%=user.FirstName%> <%=user.MiddleName%></td>
				<td class="<%=clazz %>"><%=user.Destinations[0].Zip%></td>
				<td class="<%=clazz %>"><a href="contactUser.aspx?toId=<%=user.Id %>"><%=user.Email%></a></td>
				<%	foreach (Schedule schedule in this.schedules[user]) { %>
						<td class="<%=clazz %>"><%=schedule.DayOfWeek.ToString() %>, <%=schedule.ReturnHour%>:00 to <%=schedule.DepartureHour%>:00</td>
				<%	} %>
			</tr>
		<%	i = (i + 1) % 2; %>
	<%	} %>
	</tbody>
</table>
